package demo05extends;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:咭咭熊
 * Date:2021 - 09 - 23
 * Time:18:46
 */
//子类在构造的时候会首先帮助父类进行构造
    //super关键字在子类对象内部指的是父类对象的引用


class Base1{
    public Base1(String s){
        System.out.println("B");
    }
}
public class Derived extends Base1{
    public Derived(String s){
        super("D");//显示调用父类的构造方法
        System.out.println("D");
    }

    public static void main(String[] args) {
        new Derived("C");//
    }
}
